
public class GoalPopulation {
	int[][] goal;
	
	public GoalPopulation(Integer x, Integer y)
	{
		int xStart = (x/2)-6;
		int xEnd = (x/2)+6;
		goal = new int[x][y];
		for (int j=0;j<y;j++)
		{
			for(int i=xStart;i<xEnd;i++)
			{
				goal[i][j] = 1;
			}
		}
	}
	
	public GoalPopulation(Integer x, Integer y, DisplayGrid goalGrid)
	{
		int xStart = (x/2)-6;
		int xEnd = (x/2)+6;
		goal = new int[x][y];
		for (int j=0;j<y;j++)
		{
			for(int i=xStart;i<xEnd;i++)
			{
				goal[i][j] = 1;
			}
		}
		goalGrid.updateDisplaly(goal);
	}
	public int compare(EvolvedPopulation evolved)
	{
		int comparison=0;
		for( int i=0;i<evolved.getXSize();i++)
		{
			for(int j=0;j<evolved.getYSize();j++)
			{
				if(evolved.get(i, j) == goal[i][j])
					comparison++;
				else
					comparison--;
			}
		}
		return comparison;
	}

}
